<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>avalon: ConnectHandler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">avalon
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_connect_handler-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ConnectHandler Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>ConnectHandler类继承自AMQP::LibEventHandler，用于处理与AMQP相关的事件， 如连接建立、心跳接收、连接丢失和错误等。  
 <a href="#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="connect__handler_8h_source.html">connect_handler.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ConnectHandler:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_connect_handler.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaadcf2239c5b49df6595fb8d48ec8388" id="r_aaadcf2239c5b49df6595fb8d48ec8388"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaadcf2239c5b49df6595fb8d48ec8388">ConnectHandler</a> (struct event_base *evbase, <a class="el" href="class_connecter.html">Connecter</a> *connecter)</td></tr>
<tr class="memdesc:aaadcf2239c5b49df6595fb8d48ec8388"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造函数，初始化ConnectHandler对象。  <br /></td></tr>
<tr class="separator:aaadcf2239c5b49df6595fb8d48ec8388"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3b34503db4c6123cb867ec34079e95c" id="r_ac3b34503db4c6123cb867ec34079e95c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac3b34503db4c6123cb867ec34079e95c">onConnected</a> (AMQP::TcpConnection *connection) override</td></tr>
<tr class="memdesc:ac3b34503db4c6123cb867ec34079e95c"><td class="mdescLeft">&#160;</td><td class="mdescRight">当建立连接时调用。  <br /></td></tr>
<tr class="separator:ac3b34503db4c6123cb867ec34079e95c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeadd218fe0b87bb25401d9e16bd3185a" id="r_aeadd218fe0b87bb25401d9e16bd3185a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aeadd218fe0b87bb25401d9e16bd3185a">onHeartbeat</a> (AMQP::TcpConnection *connection) override</td></tr>
<tr class="memdesc:aeadd218fe0b87bb25401d9e16bd3185a"><td class="mdescLeft">&#160;</td><td class="mdescRight">当接收到心跳时调用。  <br /></td></tr>
<tr class="separator:aeadd218fe0b87bb25401d9e16bd3185a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05d1142c9f560128dd061aa3de78f14e" id="r_a05d1142c9f560128dd061aa3de78f14e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a05d1142c9f560128dd061aa3de78f14e">onLost</a> (AMQP::TcpConnection *connection) override</td></tr>
<tr class="memdesc:a05d1142c9f560128dd061aa3de78f14e"><td class="mdescLeft">&#160;</td><td class="mdescRight">当连接丢失时调用。  <br /></td></tr>
<tr class="separator:a05d1142c9f560128dd061aa3de78f14e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8d9859ce53aadf2c2992150f43c0767" id="r_ad8d9859ce53aadf2c2992150f43c0767"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad8d9859ce53aadf2c2992150f43c0767">onError</a> (AMQP::TcpConnection *connection, const char *message) override</td></tr>
<tr class="memdesc:ad8d9859ce53aadf2c2992150f43c0767"><td class="mdescLeft">&#160;</td><td class="mdescRight">当发生错误时调用。  <br /></td></tr>
<tr class="separator:ad8d9859ce53aadf2c2992150f43c0767"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>ConnectHandler类继承自AMQP::LibEventHandler，用于处理与AMQP相关的事件， 如连接建立、心跳接收、连接丢失和错误等。 </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aaadcf2239c5b49df6595fb8d48ec8388" name="aaadcf2239c5b49df6595fb8d48ec8388"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaadcf2239c5b49df6595fb8d48ec8388">&#9670;&#160;</a></span>ConnectHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ConnectHandler::ConnectHandler </td>
          <td>(</td>
          <td class="paramtype">struct event_base *</td>          <td class="paramname"><span class="paramname"><em>evbase</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_connecter.html">Connecter</a> *</td>          <td class="paramname"><span class="paramname"><em>connecter</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>构造函数，初始化ConnectHandler对象。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">evbase</td><td>事件基础，用于处理事件驱动的网络编程。 </td></tr>
    <tr><td class="paramname">connecter</td><td>连接器对象指针，用于实际的连接操作。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ac3b34503db4c6123cb867ec34079e95c" name="ac3b34503db4c6123cb867ec34079e95c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3b34503db4c6123cb867ec34079e95c">&#9670;&#160;</a></span>onConnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectHandler::onConnected </td>
          <td>(</td>
          <td class="paramtype">AMQP::TcpConnection *</td>          <td class="paramname"><span class="paramname"><em>connection</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>当建立连接时调用。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">connection</td><td>TCP连接指针，表示已建立的连接。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad8d9859ce53aadf2c2992150f43c0767" name="ad8d9859ce53aadf2c2992150f43c0767"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8d9859ce53aadf2c2992150f43c0767">&#9670;&#160;</a></span>onError()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectHandler::onError </td>
          <td>(</td>
          <td class="paramtype">AMQP::TcpConnection *</td>          <td class="paramname"><span class="paramname"><em>connection</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>message</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>当发生错误时调用。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">connection</td><td>TCP连接指针，表示发生错误的连接。 </td></tr>
    <tr><td class="paramname">message</td><td>错误信息，描述发生的错误。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aeadd218fe0b87bb25401d9e16bd3185a" name="aeadd218fe0b87bb25401d9e16bd3185a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeadd218fe0b87bb25401d9e16bd3185a">&#9670;&#160;</a></span>onHeartbeat()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectHandler::onHeartbeat </td>
          <td>(</td>
          <td class="paramtype">AMQP::TcpConnection *</td>          <td class="paramname"><span class="paramname"><em>connection</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>当接收到心跳时调用。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">connection</td><td>TCP连接指针，表示接收到心跳的连接。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a05d1142c9f560128dd061aa3de78f14e" name="a05d1142c9f560128dd061aa3de78f14e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05d1142c9f560128dd061aa3de78f14e">&#9670;&#160;</a></span>onLost()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectHandler::onLost </td>
          <td>(</td>
          <td class="paramtype">AMQP::TcpConnection *</td>          <td class="paramname"><span class="paramname"><em>connection</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>当连接丢失时调用。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">connection</td><td>TCP连接指针，表示失去的连接。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>E:/avalon/src/libavalon/<a class="el" href="connect__handler_8h_source.html">connect_handler.h</a></li>
<li>E:/avalon/src/libavalon/<b>connect_handler.cpp</b></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
